package com.leigang.swagger.service.impl;

import com.leigang.swagger.config.DataSourceType;
import com.leigang.swagger.dao.UserDao;
import com.leigang.swagger.service.IUserService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements IUserService {
    private final UserDao userDao;
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    @DataSourceType(name = "master")
    @Override
    public List<Map> getUserList() {
        return userDao.list();
    }



    @DataSourceType(name = "slave")
    @Override
    public List<Map> getUserLists() {
        return userDao.userlist();
    }
}
